home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / qlib205.zip / QLIB.ZIP / INC / VIEWSEL.ASM < prev   
Assembly Source File  |  1997-01-03  |  1KB  |  70 lines

  1. .data
  2.   lim dw ?
  3.   bas dd ?
  4.   acc dw ?
  5. .code
  6. viewsel proc,sel:word   ;prints info of selector
  7.   lsl ax,sel
  8.   mov lim,ax
  9.   mov bx,sel
  10.   mov ax,6
  11.   int 31h
  12.   shl ecx,16
  13.   mov cx,dx
  14.   mov bas,ecx
  15.   lar ax,sel
  16.   mov acc,ax
  17.   callp printf,"sel=%xh base=%xh limit=%xh acc=%b\n",sel,bas,lim,acc
  18.   shr acc,8
  19.   .if acc & 128
  20.     callp print,"(P)"
  21.   .else
  22.     callp print,"(NP)"
  23.   .endif
  24.   callp print,"(--)"
  25.   .if acc & 16
  26.     callp print,"(CD)"
  27.   .else
  28.     callp print,"(sys)"
  29.     callp print,"\n"
  30.     ret
  31.   .endif
  32.   .if acc & 8
  33.     callp print,"(C)"
  34.     .if acc & 4
  35.       callp print,"(C)"
  36.     .else
  37.       callp print,"(NC)"
  38.     .endif
  39.     .if acc & 2
  40.       callp print,"(R)"
  41.     .else
  42.       callp print,"(NR)"
  43.     .endif
  44.     .if acc & 1
  45.       callp print,"(A)"
  46.     .else
  47.       callp print,"(NA)"
  48.     .endif
  49.   .else
  50.     callp print,"(D)"
  51.     .if acc & 4
  52.       callp print,"(ED)"
  53.     .else
  54.       callp print,"(EU)"
  55.     .endif
  56.     .if acc & 2
  57.       callp print,"(W)"
  58.     .else
  59.       callp print,"(NW)"
  60.     .endif
  61.     .if acc & 1
  62.       callp print,"(A)"
  63.     .else
  64.       callp print,"(NA)"
  65.     .endif
  66.   .endif
  67.   callp print,"\n"
  68.   ret
  69. viewsel endp
  70.